home *** CD-ROM | disk | FTP | other *** search
/ Champak 143 / (Vol 143) Nov 15 2011.iso / Games / aqua_cubes.swf / scripts / frame_83 / DoAction_4.as < prev    next >
Text File  |  2011-11-15  |  2KB  |  47 lines

  1. hint.onRelease = function()
  2. {
  3.    if(_root.sp >= 100 and _root.gamemode == "story")
  4.    {
  5.       _root.sp = 0;
  6.       _root.sfx_hint.start(0,1);
  7.       var _loc2_ = board.getHint();
  8.       trace(_loc2_.dir + "," + _loc2_.step + "," + _loc2_.no);
  9.       var _loc3_ = board["block" + _loc2_.no];
  10.       var _loc4_ = undefined;
  11.       switch(_loc2_.dir)
  12.       {
  13.          case "R":
  14.             if(_loc2_.step < 0)
  15.             {
  16.                _loc2_.step += board.col;
  17.             }
  18.             _loc4_ = board.getRealBlock(_loc3_.pos.row,_loc3_.pos.col + _loc2_.step);
  19.             hint_start.gotoAndStop(1);
  20.             break;
  21.          case "C":
  22.             if(_loc2_.step < 0)
  23.             {
  24.                _loc2_.step += board.row;
  25.             }
  26.             _loc4_ = board.getRealBlock(_loc3_.pos.row + _loc2_.step,_loc3_.pos.col);
  27.             hint_start.gotoAndStop(2);
  28.       }
  29.       trace(_loc3_ + "," + _loc3_.pos.row + "," + _loc3_.pos.col);
  30.       trace(_loc4_ + "," + _loc4_.pos.row + "," + _loc4_.pos.col);
  31.       var _loc6_ = {x:0,y:0};
  32.       _loc3_.localToGlobal(_loc6_);
  33.       hint_start._parent.globalToLocal(_loc6_);
  34.       hint_start._x = _loc6_.x;
  35.       hint_start._y = _loc6_.y;
  36.       hint_start._visible = true;
  37.       var _loc5_ = {x:0,y:0};
  38.       _loc4_.localToGlobal(_loc5_);
  39.       hint_target._parent.globalToLocal(_loc5_);
  40.       hint_target._x = _loc5_.x;
  41.       hint_target._y = _loc5_.y;
  42.       hint_target._visible = true;
  43.    }
  44. };
  45. hint_start._visible = false;
  46. hint_target._visible = false;
  47.